const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
    mode: 'development',
    plugins:[
        new HtmlWebpackPlugin({
            title:'',
            template: './index.html',
			inject: 'body',
        }),
    ],
    entry: {
        app: './index.js',
        'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js',
        //'json.worker': 'monaco-editor/esm/vs/language/json/json.worker',
        //'css.worker': 'monaco-editor/esm/vs/language/css/css.worker',
        //'html.worker': 'monaco-editor/esm/vs/language/html/html.worker',
        //'ts.worker': 'monaco-editor/esm/vs/language/typescript/ts.worker'
    },
    output: {
        globalObject: 'self',
        filename: '[name].bundle.js',
        path: path.resolve(__dirname, '../web')
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use: ['style-loader', 'css-loader']
            },
            {
                test: /\.ttf$/,
                use: ['file-loader']
            }
        ]
    }
};
